/*
 * @lc app=leetcode.cn id=551 lang=golang
 *
 * [551] 学生出勤记录 I
 */
package Solutions

// @lc code=start
func checkRecord(s string) bool {
	var aCount = 0
	var lCount = 0
	for i := range s {
		switch s[i] {
		case 'A':
			aCount++
			if aCount > 1 {
				return false
			}
			lCount = 0
		case 'L':
			lCount++
			if lCount > 2 {
				return false
			}
		default:
			lCount = 0
		}

	}
	return true
}

// @lc code=end
